/*	TGErrorManager.m
 *	Part of ThinkGeek LED Clock
 *	http://tmorgan.shutupgeorge.com/thinkgeek/
 *
 * Copyright (c)2003-2006 Tim Morgan. All rights reserved. Please visit
 * http://tmorgan.shutupgeorge.com/other/license.html for more information about
 * your rights and responsibilities regarding this source code.
 */

#import "TGErrorManager.h"

const NSString *TGErrorDomain = @"TGErrorDomain";

TGErrorManager *singleton = nil;

@implementation TGErrorManager

- (void) awakeFromNib {
	singleton = self;
}

+ (TGErrorManager *) errorManager {
	return singleton;
}

- (NSError *) errorOfType:(TGError)errorType {
	return [self errorOfType:errorType userInfo:nil];
}

- (NSError *) errorOfType:(TGError)errorType userInfo:(NSDictionary *)userInfo {
	return [[[NSError alloc] initWithDomain:(NSString *)TGErrorDomain code:errorType userInfo:userInfo] autorelease];
}

@end